package org.example.demo2_lishi.one;

import org.example.demo2_lishi.one.Quadrilateral;

/**
 * 正方形
 * @author lemon
 */
public class Square implements Quadrilateral {
    private double side;

    public double getSide() {
        return side;
    }

    public void setSide(double side) {
        this.side = side;
    }

    @Override
    public double getLength() {
        return side;
    }

    @Override
    public double getWidth() {
        return side;
    }

    @Override
    public void getArea() {
        double area = side * side;
        System.out.println("面积为：" + area);
    }

    @Override
    public void getPerimeter() {
        double perimeter = side * 4 ;
        System.out.println("周长为: "+ perimeter);
    }

}
